package com.lagou.edu.service;

import com.lagou.edu.pojo.AuthCode;
import com.lagou.edu.pojo.Token;
import com.lagou.edu.service.impl.CodeFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "lagou-service-code", fallback = CodeFeignFallback.class, path = "/api/code")
public interface CodeFeignClient {

    @GetMapping(value = "/auth/save", consumes = "application/json")
    ModelMap sendEmail(@RequestBody AuthCode authCode);

    @GetMapping(value = "/auth/get", consumes = "application/json")
    ModelMap checkCode(@RequestBody AuthCode authCode);

    @GetMapping(value = "/token/save", consumes = "application/json")
    Long saveToken(@RequestBody Token token);

    @GetMapping(value = "/token/get/token", consumes = "application/json")
    String getToken(@RequestBody Token token);

    @GetMapping(value = "/token/get/email", consumes = "application/json")
    String getEmail(@RequestBody Token token);



}
